package com.lovo.view.info;

import com.lovo.javafxComponent.LovoButton;
import com.lovo.javafxComponent.LovoPassword;
import com.lovo.javafxComponent.LovoTitle;
import com.lovo.view.LoginView;
import javafx.scene.layout.BorderPane;
import javafx.scene.layout.Pane;

/**
 * 修改密码面板
 * @author lovo
 *
 */
public class UpdatePwdPane extends Pane {
	/**根容器*/
	private BorderPane root;
	/**登陆用户*/
	private Object loginUser;
	/**旧密码框*/
	private LovoPassword oldPwdTxt = new LovoPassword("请输入旧密码", 200, 200, this);
	/**新密码框*/
	private LovoPassword newPwdTxt = new LovoPassword("请输入新密码", 200, 280, this);
	/**确认密码框*/
	private LovoPassword rePwdTxt = new LovoPassword("请确认新密码", 200, 360, this);
	public UpdatePwdPane(BorderPane root) {
		this.root = root;
		this.initComponent();
	}
	/**
	 * 初始化组件
	 */
	private void initComponent() {
		new LovoTitle("修改密码",0,80,this);
		
		LovoButton updateButton = new LovoButton("修改", 320, 440, this);
		updateButton.setOnAction(e -> updatePwd());
	}
	
	//----------------------
	/**
	 * 修改密码
	 */
	private void updatePwd() {
		root.getChildren().clear();
		new LoginView(root);
	}
}
